

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
    <style>
    /* base */
    html,
    body,
    .container {
      width: 100%;
      height: 100%;
    }

    a,
    a:link,
    a:visited {
      text-decoration: none;
      color: inherit;
    }

    ul {
      list-style: none;
    }

    *,
    ::before,
    ::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    *:focus {
      outline: 0;
    }

    .container {
      display: flex;
      padding-top: 20px;
    }

    /* Nav */
    .container .doc-nav {
      position: fixed;
      height: 100%;
      margin: 0 30px 0 40px;
      width: 280px;
    }

    .doc-nav .nav-header {
      display: flex;
      align-items: center;
      box-sizing: border-box;
      background-color: rgb(240, 241, 242);
      height: 40px;
      padding: 16px;
      font-size: 18px;
      font-weight: 500;
      color: rgb(62, 64, 66);
      cursor: pointer;
    }

    .doc-nav .nav-content {
      height: calc(100% - 40px);
      overflow-y: auto;
      color: rgb(32, 34, 36);
    }

    .doc-nav .nav-content .nav-list,
    .doc-nav .nav-content .nav-sub-list {
      line-height: 1.5rem;
    }

    .doc-nav .nav-content .nav-label {
      display: inline-block;
      position: relative;
      padding: 2px 0 2px 20px;
      margin-bottom: 4px;
    }

    .doc-nav .nav-content .nav-sub-label {
      position: relative;
      padding: 2px 0 2px 40px;
      font-size: 14px;
    }

    .doc-nav .nav-content .nav-sub-label:hover {
      text-decoration: underline;
    }

    .doc-nav .nav-content .nav-list .nav-label.group::before {
      border-bottom: 0.25rem solid transparent;
      border-left: 0.25rem solid #6e7072;
      border-right: 0;
      border-top: 0.25rem solid transparent;
      content: '';
      display: block;
      height: 0;
      left: 0.5rem;
      position: absolute;
      top: 0.625rem;
      transition: transform 0.1s linear;
      width: 0;
    }

    .doc-nav .nav-content .nav-list .nav-label.group.active::before {
      transform: rotate(90deg);
    }

    /* doc content */
    .container .doc-content {
      position: fixed;
      height: 100%;
      width: calc(100% - 80px - 40px - 30px - 240px);
      right: 0%;
      overflow-y: auto;
    }

    .doc-title {
      border-bottom: 1px solid #dcdee0;
      font-size: 22px;
      margin: 8px 0 0;
      padding-bottom: 16px;
    }

    .doc-content h3 {
      font-size: 24px;
      font-weight: 600;
      margin: 24px 0;
    }

    .doc-content h4 {
      font-size: 22px;
      font-weight: 500;
      margin: 30px 0 8px;
    }

    .doc-content h4 span {
      color: #007d9c;
    }

    .doc-content .doc-declare {
      background-color: #fafafa;
      border-radius: 5px;
      border: 1px solid #ccc;
      font-size: 14px;
      overflow-x: auto;
      padding: 10px;
      tab-size: 4;
      line-height: 20px;
    }

    .doc-content .doc-comment {
      font-size: 16px;
      margin: 16px 0;
      line-height: 24px;
      word-break: break-word;
    }
  </style>

</head>
<body>
  <div class="container">
    <div class="doc-nav">
      <a href="#Documentation" class="nav-header">Documentation</a>
      <nav class="nav-content">
        <ul class="nav-list">
          <li>
            <a href="#includes" class="nav-label">Includes</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#config.h" class="nav-sub-label">config.h</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_CONFIG_FILE" class="nav-sub-label">MBEDTLS_CONFIG_FILE</a>
              </li>
      

              <li>
                <a href="#stddef.h" class="nav-sub-label">stddef.h</a>
              </li>
      

              <li>
                <a href="#stdint.h" class="nav-sub-label">stdint.h</a>
              </li>
      

              <li>
                <a href="#sha256_alt.h" class="nav-sub-label">sha256_alt.h</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#macros" class="nav-label">Macros</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#MBEDTLS_SHA256_H" class="nav-sub-label">MBEDTLS_SHA256_H</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED" class="nav-sub-label">MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_ERR_SHA256_BAD_INPUT_DATA" class="nav-sub-label">MBEDTLS_ERR_SHA256_BAD_INPUT_DATA</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_DEPRECATED" class="nav-sub-label">MBEDTLS_DEPRECATED</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_DEPRECATED" class="nav-sub-label">MBEDTLS_DEPRECATED</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_DEPRECATED" class="nav-sub-label">MBEDTLS_DEPRECATED</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_DEPRECATED" class="nav-sub-label">MBEDTLS_DEPRECATED</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#functions" class="nav-label">Functions</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#mbedtls_sha256_init" class="nav-sub-label">mbedtls_sha256_init</a>
              </li>
      

              <li>
                <a href="#mbedtls_sha256_free" class="nav-sub-label">mbedtls_sha256_free</a>
              </li>
      

              <li>
                <a href="#mbedtls_sha256_clone" class="nav-sub-label">mbedtls_sha256_clone</a>
              </li>
      

              <li>
                <a href="#mbedtls_sha256_starts_ret" class="nav-sub-label">mbedtls_sha256_starts_ret</a>
              </li>
      

              <li>
                <a href="#mbedtls_sha256_update_ret" class="nav-sub-label">mbedtls_sha256_update_ret</a>
              </li>
      

              <li>
                <a href="#mbedtls_sha256_finish_ret" class="nav-sub-label">mbedtls_sha256_finish_ret</a>
              </li>
      

              <li>
                <a href="#mbedtls_internal_sha256_process" class="nav-sub-label">mbedtls_internal_sha256_process</a>
              </li>
      

              <li>
                <a href="#mbedtls_sha256_ret" class="nav-sub-label">mbedtls_sha256_ret</a>
              </li>
      

              <li>
                <a href="#mbedtls_sha256_self_test" class="nav-sub-label">mbedtls_sha256_self_test</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#vars" class="nav-label">Vars</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#MBEDTLS_DEPRECATED" class="nav-sub-label">MBEDTLS_DEPRECATED</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_DEPRECATED" class="nav-sub-label">MBEDTLS_DEPRECATED</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_DEPRECATED" class="nav-sub-label">MBEDTLS_DEPRECATED</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_DEPRECATED" class="nav-sub-label">MBEDTLS_DEPRECATED</a>
              </li>
      

              <li>
                <a href="#MBEDTLS_DEPRECATED" class="nav-sub-label">MBEDTLS_DEPRECATED</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#consts" class="nav-label">Consts</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#types" class="nav-label">Types</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#typedefs" class="nav-label">Typedefs</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#
mbedtls_sha256_context;
" class="nav-sub-label">
mbedtls_sha256_context;
</a>
              </li>
      
            </ul>
            
          </li>
        </ul>
      </nav>
    </div>
    <div class="doc-content">
      <h2 id="Documentation" class="doc-title">Documentation</h2>
      <h3 id="includes">Includes</h3>
      

      <h4 id="config.h"><span>config.h</span></h4>
      <pre class="doc-declare"><code>#include "config.h"
</code></pre>
      <pre class="doc-comment">#include "config.h"
</pre>

      <h4 id="MBEDTLS_CONFIG_FILE"><span>MBEDTLS_CONFIG_FILE</span></h4>
      <pre class="doc-declare"><code>#include MBEDTLS_CONFIG_FILE
</code></pre>
      <pre class="doc-comment">#include MBEDTLS_CONFIG_FILE
</pre>

      <h4 id="stddef.h"><span>stddef.h</span></h4>
      <pre class="doc-declare"><code>#include &lt;stddef.h&gt;
</code></pre>
      <pre class="doc-comment">#include <stddef.h>
</pre>

      <h4 id="stdint.h"><span>stdint.h</span></h4>
      <pre class="doc-declare"><code>#include &lt;stdint.h&gt;
</code></pre>
      <pre class="doc-comment">#include <stdint.h>
</pre>

      <h4 id="sha256_alt.h"><span>sha256_alt.h</span></h4>
      <pre class="doc-declare"><code>#include "sha256_alt.h"
</code></pre>
      <pre class="doc-comment">#include "sha256_alt.h"
</pre>
      <h3 id="macros">Macros</h3>
      

      <h4 id="MBEDTLS_SHA256_H">Marco <span>MBEDTLS_SHA256_H</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_SHA256_H
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED">Marco <span>MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED               -55 /**< SHA-256 hardware accelerator failed */
</code></pre>
      <pre class="doc-comment">/* MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED is deprecated and should not be used. */</pre>

      <h4 id="MBEDTLS_ERR_SHA256_BAD_INPUT_DATA">Marco <span>MBEDTLS_ERR_SHA256_BAD_INPUT_DATA</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_ERR_SHA256_BAD_INPUT_DATA                -116 /**< SHA-256 input data was malformed. */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_DEPRECATED">Marco <span>MBEDTLS_DEPRECATED</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_DEPRECATED     __attribute__((deprecated))
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_DEPRECATED">Marco <span>MBEDTLS_DEPRECATED</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_DEPRECATED
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_DEPRECATED">Marco <span>MBEDTLS_DEPRECATED</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_DEPRECATED     __attribute__((deprecated))
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MBEDTLS_DEPRECATED">Marco <span>MBEDTLS_DEPRECATED</span></h4>
      <pre class="doc-declare"><code>#define MBEDTLS_DEPRECATED
</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="functions">Functions</h3>
      

      <h4 id="mbedtls_sha256_init">Func <span>mbedtls_sha256_init</span></h4>
      <pre class="doc-declare"><code>void mbedtls_sha256_init( mbedtls_sha256_context *ctx );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function initializes a SHA-256 context.
 *
 * \param ctx      The SHA-256 context to initialize. This must not be \c NULL.
 */</pre>

      <h4 id="mbedtls_sha256_free">Func <span>mbedtls_sha256_free</span></h4>
      <pre class="doc-declare"><code>void mbedtls_sha256_free( mbedtls_sha256_context *ctx );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function clears a SHA-256 context.
 *
 * \param ctx      The SHA-256 context to clear. This may be \c NULL, in which
 *                 case this function returns immediately. If it is not \c NULL,
 *                 it must point to an initialized SHA-256 context.
 */</pre>

      <h4 id="mbedtls_sha256_clone">Func <span>mbedtls_sha256_clone</span></h4>
      <pre class="doc-declare"><code>void mbedtls_sha256_clone( mbedtls_sha256_context *dst,
                          const mbedtls_sha256_context *src );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function clones the state of a SHA-256 context.
 *
 * \param dst      The destination context. This must be initialized.
 * \param src      The context to clone. This must be initialized.
 */</pre>

      <h4 id="mbedtls_sha256_starts_ret">Func <span>mbedtls_sha256_starts_ret</span></h4>
      <pre class="doc-declare"><code>int mbedtls_sha256_starts_ret( mbedtls_sha256_context *ctx, int is224 );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function starts a SHA-224 or SHA-256 checksum
 *                 calculation.
 *
 * \param ctx      The context to use. This must be initialized.
 * \param is224    This determines which function to use. This must be
 *                 either \c 0 for SHA-256, or \c 1 for SHA-224.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */</pre>

      <h4 id="mbedtls_sha256_update_ret">Func <span>mbedtls_sha256_update_ret</span></h4>
      <pre class="doc-declare"><code>int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx,
                              const unsigned char *input,
                              size_t ilen );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function feeds an input buffer into an ongoing
 *                 SHA-256 checksum calculation.
 *
 * \param ctx      The SHA-256 context. This must be initialized
 *                 and have a hash operation started.
 * \param input    The buffer holding the data. This must be a readable
 *                 buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */</pre>

      <h4 id="mbedtls_sha256_finish_ret">Func <span>mbedtls_sha256_finish_ret</span></h4>
      <pre class="doc-declare"><code>int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx,
                              unsigned char output[32] );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function finishes the SHA-256 operation, and writes
 *                 the result to the output buffer.
 *
 * \param ctx      The SHA-256 context. This must be initialized
 *                 and have a hash operation started.
 * \param output   The SHA-224 or SHA-256 checksum result.
 *                 This must be a writable buffer of length \c 32 Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */</pre>

      <h4 id="mbedtls_internal_sha256_process">Func <span>mbedtls_internal_sha256_process</span></h4>
      <pre class="doc-declare"><code>int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx,
                                    const unsigned char data[64] );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function processes a single data block within
 *                 the ongoing SHA-256 computation. This function is for
 *                 internal use only.
 *
 * \param ctx      The SHA-256 context. This must be initialized.
 * \param data     The buffer holding one block of data. This must
 *                 be a readable buffer of length \c 64 Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */</pre>

      <h4 id="mbedtls_sha256_ret">Func <span>mbedtls_sha256_ret</span></h4>
      <pre class="doc-declare"><code>int mbedtls_sha256_ret( const unsigned char *input,
                       size_t ilen,
                       unsigned char output[32],
                       int is224 );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function calculates the SHA-224 or SHA-256
 *                 checksum of a buffer.
 *
 *                 The function allocates the context, performs the
 *                 calculation, and frees the context.
 *
 *                 The SHA-256 result is calculated as
 *                 output = SHA-256(input buffer).
 *
 * \param input    The buffer holding the data. This must be a readable
 *                 buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 * \param output   The SHA-224 or SHA-256 checksum result. This must
 *                 be a writable buffer of length \c 32 Bytes.
 * \param is224    Determines which function to use. This must be
 *                 either \c 0 for SHA-256, or \c 1 for SHA-224.
 */</pre>

      <h4 id="mbedtls_sha256_self_test">Func <span>mbedtls_sha256_self_test</span></h4>
      <pre class="doc-declare"><code>int mbedtls_sha256_self_test( int verbose );</code></pre>
      <pre class="doc-comment">/**
 * \brief          The SHA-224 and SHA-256 checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */</pre>
      <h3 id="vars">Vars</h3>
      

      <h4 id="MBEDTLS_DEPRECATED">Variable <span>MBEDTLS_DEPRECATED</span></h4>
      <pre class="doc-declare"><code>MBEDTLS_DEPRECATED void mbedtls_sha256_starts( mbedtls_sha256_context *ctx,
                                              int is224 );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function starts a SHA-224 or SHA-256 checksum
 *                 calculation.
 *
 * \deprecated     Superseded by mbedtls_sha256_starts_ret() in 2.7.0.
 *
 * \param ctx      The context to use. This must be initialized.
 * \param is224    Determines which function to use. This must be
 *                 either \c 0 for SHA-256, or \c 1 for SHA-224.
 */</pre>

      <h4 id="MBEDTLS_DEPRECATED">Variable <span>MBEDTLS_DEPRECATED</span></h4>
      <pre class="doc-declare"><code>MBEDTLS_DEPRECATED void mbedtls_sha256_update( mbedtls_sha256_context *ctx,
                                              const unsigned char *input,
                                              size_t ilen );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function feeds an input buffer into an ongoing
 *                 SHA-256 checksum calculation.
 *
 * \deprecated     Superseded by mbedtls_sha256_update_ret() in 2.7.0.
 *
 * \param ctx      The SHA-256 context to use. This must be
 *                 initialized and have a hash operation started.
 * \param input    The buffer holding the data. This must be a readable
 *                 buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 */</pre>

      <h4 id="MBEDTLS_DEPRECATED">Variable <span>MBEDTLS_DEPRECATED</span></h4>
      <pre class="doc-declare"><code>MBEDTLS_DEPRECATED void mbedtls_sha256_finish( mbedtls_sha256_context *ctx,
                                              unsigned char output[32] );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function finishes the SHA-256 operation, and writes
 *                 the result to the output buffer.
 *
 * \deprecated     Superseded by mbedtls_sha256_finish_ret() in 2.7.0.
 *
 * \param ctx      The SHA-256 context. This must be initialized and
 *                 have a hash operation started.
 * \param output   The SHA-224 or SHA-256 checksum result. This must be
 *                 a writable buffer of length \c 32 Bytes.
 */</pre>

      <h4 id="MBEDTLS_DEPRECATED">Variable <span>MBEDTLS_DEPRECATED</span></h4>
      <pre class="doc-declare"><code>MBEDTLS_DEPRECATED void mbedtls_sha256_process( mbedtls_sha256_context *ctx,
                                               const unsigned char data[64] );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function processes a single data block within
 *                 the ongoing SHA-256 computation. This function is for
 *                 internal use only.
 *
 * \deprecated     Superseded by mbedtls_internal_sha256_process() in 2.7.0.
 *
 * \param ctx      The SHA-256 context. This must be initialized.
 * \param data     The buffer holding one block of data. This must be
 *                 a readable buffer of size \c 64 Bytes.
 */</pre>

      <h4 id="MBEDTLS_DEPRECATED">Variable <span>MBEDTLS_DEPRECATED</span></h4>
      <pre class="doc-declare"><code>MBEDTLS_DEPRECATED void mbedtls_sha256( const unsigned char *input,
                                       size_t ilen,
                                       unsigned char output[32],
                                       int is224 );</code></pre>
      <pre class="doc-comment">/**
 * \brief          This function calculates the SHA-224 or SHA-256 checksum
 *                 of a buffer.
 *
 *                 The function allocates the context, performs the
 *                 calculation, and frees the context.
 *
 *                 The SHA-256 result is calculated as
 *                 output = SHA-256(input buffer).
 *
 * \deprecated     Superseded by mbedtls_sha256_ret() in 2.7.0.
 *
 * \param input    The buffer holding the data. This must be a readable
 *                 buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 * \param output   The SHA-224 or SHA-256 checksum result. This must be
 *                 a writable buffer of length \c 32 Bytes.
 * \param is224    Determines which function to use. This must be either
 *                 \c 0 for SHA-256, or \c 1 for SHA-224.
 */</pre>
      <h3 id="consts">Consts</h3>
      
      <h3 id="types">Types</h3>
      
      <h3 id="typedefs">Typedefs</h3>
      

      <h4 id="
mbedtls_sha256_context;
">Typedef <span>
mbedtls_sha256_context;
</span></h4>
      <pre class="doc-declare"><code>typedef struct mbedtls_sha256_context
{
   uint32_t total[2];         /*!< The number of Bytes processed.  */
   uint32_t state[8];         /*!< The intermediate digest state.  */
   unsigned char buffer[64];  /*!< The data block being processed. */
   int is224;                 /*!< Determines which function to use:
                                     0: Use SHA-256, or 1: Use SHA-224. */
}
mbedtls_sha256_context;
</code></pre>
      <pre class="doc-comment">/**
 * \brief          The SHA-256 context structure.
 *
 *                 The structure is used both for SHA-256 and for SHA-224
 *                 checksum calculations. The choice between these two is
 *                 made in the call to mbedtls_sha256_starts_ret().
 */</pre>
    </div>
  </body>
</html>
            